package com.cande.loki.exercise.dynamicproxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @auther ROCK CODER
 * @DATE 2022/3/24 21:17
 * @Description
 */
public class ManHandler implements InvocationHandler {
    Man man;

    public ManHandler(Man man) {
        this.man = man;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("1111");
        method.invoke(man);
        System.out.println("2222");
        return null;
    }

}
